<template lang="pug">
  .ctrl-bar(:class="[getType ? 'ctrl-bar-big' : 'ctrl-bar-mid', getBarPos]")
    .icon.close(@click="handleClose")
      i.iconfont &#xe60b;
    a.icon.link(v-if='getBarLink', :href="getBarLink", target="_blank")
      i.iconfont &#xe686;
</template>

<script>
import posMixin from '@/mixins/pos'
export default {
  name: 'ctrlBar',
  mixins: [posMixin],
  props: {
    pos: {
      type: String,
      default: 'top'
    },
    link: {
      type: String,
      default: ''
    }
  },
  data() {
    return {

    }
  },
  methods: {
    handleClose() {
      this.$emit('closeBar')
    }
  },
  computed: {
    getBarPos() {
      return 'ctrl-bar-' + this.pos
    },
    getBarLink() {
      return this.link
    }
  }
}
</script>

<style lang="stylus">

</style>
